<?php

namespace app\controller;

use app\service\DelayStatService;
use app\service\TaskService;
use support\Request;
use support\Response;

class DelayStatController
{
    /**
     * @var TaskService
     */
    private $service;

    public function __construct()
    {
        $this->service = DelayStatService::getInstance();
    }


    /**
     * 延期统计--列表
     * @param Request $request
     * @return Response
     */
    public function getList(Request $request): Response
    {
        $param = $request->post()['param'];
        $param['page'] = $param['page'] ?? [1, config("database.database_max_select_rows")];

        $res = $this->service->getList($param, $param['page']);

        return json(success_response('', $res));
    }

}
